#define _CRT_SECURE_NO_WARNINGS 1

class Solution {
public:
    string transform(int n)
    {
        string str;
        int i = 1;
        while (n >= i)
        {
            if ((n & i) == i) str += '1';
            else str += '0';
            i <<= 1;
        }
        reverse(str.begin(), str.end());
        return str;
    }
    string convertDateToBinary(string date) {
        string str;
        str += transform(atoi(date.substr(0, 4).c_str()));
        str += '-';
        str += transform(atoi(date.substr(5, 2).c_str()));
        str += '-';
        str += transform(atoi(date.substr(8, 2).c_str()));
        return str;
    }
};